<template>
  <div class="main-message">
    <el-form ref="form" v-model="formInfo">
      <el-row type="flex" justify="space-around">
        <!--       基本信息 -->
        <el-col>

          <div v-if="isShow.self" class="selectContent">
<!--            <d-c-top-bar @dcAcquireInfo="dcAcquireInfo" />-->
            <!--            数据中心模块显示-->
            <div />
            <div>
              <base-message
                :selected-result="selectedResult"
                :father="father"
                :is-show="isShow"
                :is-pass-value2="isPassValue2"
                @chooseDialog="chooseDialog"
                @acquireInfo2="acquireInfo2"
              /></div>
          </div>
        </el-col>
      </el-row>
    </el-form>
    <main-dialog
      :is-visible="isVisible"
      :dialog-info="dialogInfo"
      @closeDialog="closeDialog"
      @selectedResultMain="selectedResultMain"
    />
  </div>
</template>

<script>
import BaseMessage from '../../childComps/FormInfo/BaseMessage'
import MainDialog from '../../childComps/Dialog/MainDialog'
export default {
  name: 'ReportForm',
  components: {
    BaseMessage,
    MainDialog,
  },
  props: {
    isShow: {
      type: Object,
      default: null
    },
    father: {
      type: String,
      default: null
    }
  },
  data() {
    return {
      formInfo: {},
      isVisible: false,
      //  isPassValue当为true的时候，就能够通过子传父将表单值传过来
      isPassValue2: false,
      //  保存选择按钮的相关数据
      dialogInfo: {
        type: Object,
        default: null
      },
      // 穿梭框数据
      selectedResult: ''
    }
  },
  methods: {
    //  保存selectedResult
    selectedResultMain(value) {
      this.selectedResult = value
      this.isVisible = false
    },
    chooseDialog(dialogInfo) {
      this.dialogInfo = dialogInfo
      this.isVisible = true
    },
    closeDialog() {
      this.isVisible = false
    },
    //  获取查询的条件
    //  需要定义函数进行数据出来，根据后台需要
    dcAcquireInfo() {
      this.isPassValue2 = true
    },
    acquireInfo2(value) {
      this.allInfo = value
      this.isPassValue2 = false
      console.log(this.allInfo)
    }
  }
}
</script>

<style scoped lang="scss">
  .main-message{
    font-size: 12px;
  }
  .base-message div{
    margin-bottom: 5px;
  }

</style>
